﻿using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using MathTutorPro.Data.Entities;
using System.Reflection.Emit;

namespace MathTutorPro.DAL
{
    public class AppDbContext : IdentityDbContext<AppUser>
    {
        public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) { }

        public DbSet<Class> Class { get; set; }
        public DbSet<ClassDetail> ClassDetail { get; set; }
        public DbSet<ChatGroup> ChatGroup { get; set; }
        public DbSet<ChatGroupMember> ChatGroupMember { get; set; }
        public DbSet<ChatGroupMessage> ChatGroupMessage { get; set; }
        public DbSet<ChatPrivate> ChatPrivate { get; set; }
        public DbSet<ChatPrivateMessage> ChatPrivateMessage { get; set; }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            // 自动注册所有 IEntityTypeConfiguration<T>
            //builder.ApplyConfigurationsFromAssembly(typeof(AppDbContext).Assembly);
            base.OnModelCreating(builder);
        }
    }


}
